#include <iostream>
#include <string>
#include <stack>
using namespace std;
string c;
stack <char> s;
stack <char> s1;
int main() {
	getline (cin, c);
	for (int i = 0; i < c.size(); i++) {
		if (c[i] == '@') {
			while (!s.empty()) {
				s.pop();
			}
		} else if (c[i] == '#') {
			if (s.size() >= 1) {
				s.pop();
			}
		} else {
			s.push(c[i]);
		}
	}
	while (!s.empty()) {
		s1.push(s.top());
		s.pop();
	}
	while (!s1.empty()) {
		cout << s1.top();
		s1.pop();
	}
	return 0;
}
